package com.miaoxun.web.config;


import com.miaoxun.common.util.Constant;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Component
public  class WebConfigurer implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/img/**").addResourceLocations("file:///" + Constant.UPLOADPATHIMG);//img配置路径
        registry.addResourceHandler("/txt/**").addResourceLocations("file:///" + Constant.TXTPATHIMG);//txt配置路径
        registry.addResourceHandler("/file/**").addResourceLocations("file:///" + Constant.FILEPATHIMG);//file配置路径
    }

}